#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int n = 0, arr[101] = { 0 }, count = 0;
    while (~scanf("%d", &n))
    {
        int i = 0;
        for (i = 2; i <= n; i++)
        {
            arr[i] = i;
        }
        for (i = 2; i <= n; i++)
        {
            int j = 0;
            for (j = i + 1; j <= n; j++)
            {
                if (arr[j] % i == 0)
                {
                    arr[j] = 0;
                }
            }
        }
        for (i = 2; i <= n; i++)
        {
            if (arr[i] != 0)
            {
                printf("%d ", arr[i]);
            }
            else {
                count++;
            }
        }
        printf("\n%d\n", count);
    }
    return 0;
}
